<template>
  <div class="prefer_card">
    <div class="left">
      <h3>优惠券立减20元</h3>
      <h5>全场满500减20</h5>
    </div>
    <div
      class="right"
      @click="this.ok1=!ok1,this.ok2=true,this.ok3=true"
    >
      <div
        class="box1"
        v-if="ok1"
      >
        <h3>2022-11-11</h3>
        <h5>即将失效</h5>
      </div>
      <div
        class="box2"
        v-else
      >
        <h3>已选择</h3>
        <h5>立减20元</h5>
      </div>
    </div>
  </div>
  <div class="prefer_card">
    <div class="left">
      <h3>优惠券立减20元</h3>
      <h5>全场满500减20</h5>
    </div>
    <div
      class="right"
      @click="this.ok1=true,this.ok2=!ok2,this.ok3=true"
    >
      <div
        class="box1"
        v-if="ok2"
      >
        <h3>2022-11-11</h3>
        <h5>即将失效</h5>
      </div>
      <div
        class="box2"
        v-else
      >
        <h3>已选择</h3>
        <h5>立减20元</h5>
      </div>
    </div>
  </div>
  <div class="prefer_card">
    <div class="left">
      <h3>优惠券立减20元</h3>
      <h5>全场满500减20</h5>
    </div>
    <div
      class="right"
      @click="this.ok1=true,this.ok2=true,this.ok3=!ok3"
    >
      <div
        class="box1"
        v-if="ok3"
      >
        <h3>2022-11-11</h3>
        <h5>即将失效</h5>
      </div>
      <div
        class="box2"
        v-else
      >
        <h3>已选择</h3>
        <h5>立减20元</h5>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      ok1: false,
      ok2: true,
      ok3: true,
    }
  },
  methods: {
  },
}
</script>

<style lang="scss" scoped>
.nut-popup {
  .title {
    font-weight: 400;
    font-size: 16px;
    text-align: center;
    margin-top: 18px;
    position: fixed;
  }
  .prefer_card {
    width: 340px;
    height: 135px;
    margin: 10px auto;
    display: flex;
    justify-content: space-around;
    .left {
      width: 230px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background-color: #debb8c;
      border-radius: 0 10px 10px 0;
      h3 {
        font-weight: 700;
        font-size: 24px;
        color: #f6f4ea;
      }
      h5 {
        font-weight: 400;
        font-size: 12px;
        color: #d1082a;
        display: inline-block;
        width: 70%;
        text-align: center;
        background-color: #c1ab96;
      }
    }
    .right {
      width: 110px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background-color: #debb8c;

      border-radius: 10px 0 0 10px;
      .box1 {
        height: 70%;
        width: 100%;
        border-left: 1px dashed #f6f4ea;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        h3 {
          font-size: 14px;
          color: #f6f4ea;
        }
        h5 {
          font-size: 14px;
          color: #f6f4ea;
        }
      }
      .box2 {
        height: 70%;
        width: 100%;
        border-left: 1px dashed #f6f4ea;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        h3 {
          font-weight: 700;
          font-size: 16px;
          color: #d1082a;
        }
        h5 {
          font-weight: 700;
          font-size: 16px;
          color: #d1082a;
        }
      }
    }
  }
}
</style>